import { Controller, Get, Query, Request } from '@nestjs/common'
import { ApiOperation, ApiTags } from '@nestjs/swagger'
import { ListUserDto } from './dto'
import { UserService } from './user.service'

@ApiTags('用户管理')
@Controller('/system/user')
export class UserController {
  constructor(private readonly userService: UserService) {}

  @ApiOperation({ summary: '用户-列表' })
  @Get('/list')
  findAll(@Query() query: ListUserDto, @Request() req) {
    const user = req.user.user
    return this.userService.findAll(query, user)
  }
}
